home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Demo's / Tools&Utilities / Programming / HELP language 1.4 / Help Files / System files / HelpToStrict < prev    next >
Encoding:
Text File  |  1992-12-28  |  812 b   |  20 lines  |  [TEXT/Help]

  1. {•••••••• Some code to turn Help into a really strict language •••••••••}
  2. {•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••}
  3. {•••NB: You should also paste the "Strict.res" ressources in "Paresseux"}
  4.  
  5. {••• First of all, let's modify lambda }
  6. (coerce 'lambda 6)         ;turns lambda into a normal symbol
  7. (=! system:lambda lambda)  ;get lambda code in system:lambda symbol
  8. (defmacro (lambda | l)
  9.   `(setstrict (system:lambda ,@l) %1111111111111111))
  10.                            ;lambda creates now strict closures !
  11. (coerce 'system:lambda 10) ;turns system:lambda into a keyword
  12.  
  13. {••• Now define…}
  14. (coerce 'define 6)
  15. (=! system:define define)
  16. (defmacro (define f | b)
  17.   (cond (cons? f) `(system:define ,(0 f) (lambda ,(-1 f) ,@b))
  18.         `(system:define ,f ,@b)))
  19. (coerce 'system:define 10)
  20.